package server.demo.dto;

import server.demo.entity.Carriage;

public class CarriageDTO {
    private Long id;
    private Long trainId;
    private String trainNumber;
    private Integer carriageNumber;
    private String carriageType;
    private Integer totalSeats;
    private Integer availableSeats;
    
    public CarriageDTO() {}
    
    public CarriageDTO(Carriage carriage) {
        this.id = carriage.getId();
        this.trainId = carriage.getTrain().getId();
        this.trainNumber = carriage.getTrain().getTrainNumber();
        this.carriageNumber = carriage.getCarriageNumber();
        this.carriageType = carriage.getCarriageType().name();
        this.totalSeats = carriage.getTotalSeats();
    }
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getTrainId() {
        return trainId;
    }
    
    public void setTrainId(Long trainId) {
        this.trainId = trainId;
    }
    
    public String getTrainNumber() {
        return trainNumber;
    }
    
    public void setTrainNumber(String trainNumber) {
        this.trainNumber = trainNumber;
    }
    
    public Integer getCarriageNumber() {
        return carriageNumber;
    }
    
    public void setCarriageNumber(Integer carriageNumber) {
        this.carriageNumber = carriageNumber;
    }
    
    public String getCarriageType() {
        return carriageType;
    }
    
    public void setCarriageType(String carriageType) {
        this.carriageType = carriageType;
    }
    
    public Integer getTotalSeats() {
        return totalSeats;
    }
    
    public void setTotalSeats(Integer totalSeats) {
        this.totalSeats = totalSeats;
    }
    
    public Integer getAvailableSeats() {
        return availableSeats;
    }
    
    public void setAvailableSeats(Integer availableSeats) {
        this.availableSeats = availableSeats;
    }
}